import 'package:kmxy_base/base/base_package.dart';

import 'form_page_state.dart';

class FormPageView extends FormPageState {
  @override
  destroyData() {}

  @override
  initData() {}

  Map data = {
    'test1': '清晰',
    'test2': '哈哈哈回单卡很多事卡号打卡号地块哈萨克德哈卡和带宽',
    'test2_1': '请选择',
    'test3': '请选择',
  };

  List listData = [
    {'key': 1, 'name': '哈哈'},
    {'key': 2, 'name': '阿萨'},
    {'key': 3, 'name': '撒飒飒'},
  ];

  @override
  Widget setPageContent(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text(
          "表单案例",
        ),
      ),
      body: SafeArea(
        child: ListView(
          children: [
            FormWidget(
              isStar: true,
              leftData: '输入框：',
              rightData: data,
              rightValue: 'test1',
            ),
            FormWidget(
              leftData: 'Map选择（单选）：',
              rightData: data,
              rightKey: 'test2_1',
              rightValue: 'test2',
              type: 1,
              selectList: listData,
              selectListName: 'name',
              selectListKey: 'key',
            ),
            FormWidget(
              leftData: '时间选择：',
              rightData: data,
              rightValue: 'test3',
              type: 2,
            ),
            TextButton(
                onPressed: () {
                  print(data);
                },
                child: const Text("获取")),
          ],
        ),
      ),
    );
  }
}
